window.onload=function(){
 let mydiv=document.getElementById("mydiv");
 console.log(typeof mydiv)
 if(mydiv instanceof HTMLElement){
    mydiv.addEventListener("click",(e)=>{
        mydiv.classList.toggle("myfont")
    })
    console.log("是的是HTMLElement")
 }
 let input=prompt("输入姓名：")
 let mydiv1 = document.getElementById("mydiv1")
 if(mydiv1 instanceof HTMLElement){
    mydiv1.addEventListener("click", (e) => {
        const target = e.target as HTMLElement;
        console.log(target.textContent);
    })
    console.log("是的是HTMLElement")
 }
}